package com.qingzhou.web.repository.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.Fastjson2TypeHandler;
import com.qingzhou.common.web.domain.BaseEntity;
import com.qingzhou.common.web.domain.FileVo;
import com.qingzhou.web.service.impl.convert.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 患者信息 对象
 * @author xm
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "edc_patient")
public class PatientEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id
    @ExcelProperty("序号")
    private Long id;

    @Column(ignore = true)
    private String ids;

    /** 医院相关信息 */
    @ApiModelProperty("中心入组医院id")
    @DictParent("hospital_site_dict")
    private String hospitalSite;

    @ApiModelProperty("院区编码")
    @ExcelProperty(value = "院区", converter = DistrictConverter.class)
    private String districtCode;

    /** 患者基本信息 */
    @ApiModelProperty("是否完成信息补充")
    @DictParent("sys_yes_no")
    private String isSupplemented;

    @ApiModelProperty("状态")
    private String status;

    @ApiModelProperty("患者姓名")
    private String patientName;

    @ApiModelProperty("患者编号")
    @ExcelProperty("患者编号")
    private String patientCode;

    @ApiModelProperty("所属队列")
    @ExcelProperty("所属队列")
    @DictParent("belong_queue_dict")
    private String belongQueue;

    @ApiModelProperty("检测项目")
    @ExcelProperty(value = "检测项目", converter = TestItemConverter.class)
    private String testItem;

    @ApiModelProperty("医生")
    private String doctor;

    @ApiModelProperty("住院号")
    private String beHospitalNum;

    @ApiModelProperty("手机")
    private String phone;

    @ApiModelProperty("入组日期")
    @DateTimeFormat("yyyy年MM月dd日")
    private Date enrollmentDate;

    @ApiModelProperty("性别")
    @DictParent("sys_user_sex")
    private String sex;

    @ApiModelProperty("年龄")
    private String age;

    @ApiModelProperty("民族")
    @DictParent("sys_nation_dict")
    private String nation;

    @ApiModelProperty("籍贯")
    @ExcelProperty(value = {"基本信息", "籍贯"}, converter = ReginConverter.class)
    private String birthplace;

    @ApiModelProperty("现居地")
    @ExcelProperty(value = {"基本信息", "现居地"}, converter = ReginConverter.class)
    private String currentResidence;

    @ApiModelProperty("职业")
    private String job;

    @ApiModelProperty(value="婚姻",notes = "字典 marriage_dict")
    @DictParent("marriage_dict")
    private String maritalStatus;

    @ApiModelProperty("组别。仅北大人民的时候，该字段可选干预组、观察组、真实世界组。其他医院仅可以选择干预组和真实世界组")
    @ExcelProperty(value = "组别", converter = DictConverter.class)
    @DictParent("belonging_group_dict")
    private String belongingGroup;

    @ApiModelProperty("出生日期")
    @DateTimeFormat("yyyy年MM月dd日")
    private Date birthDate;

    @ApiModelProperty("初次确诊日期")
    @DateTimeFormat("yyyy年MM月dd日")
    private Date firstDiagDate;

    @ApiModelProperty("确诊年龄")
    private String diagAge;

    @ApiModelProperty("生存情况")
    @DictParent("sys_life_status")
    private String lifeStatus;

    /** 体格检查 */
    @ApiModelProperty("身高(cm)")
    private String height;

    @ApiModelProperty("体重(Kg)")
    private String weight;

    @ApiModelProperty("ECOG体能评分")
    private String ecogScore;

    @ApiModelProperty("KPS评分")
    private String kpsScore;

    @ApiModelProperty("备注")
    private String physicalRemarks;

    /** 既往史 */
    @ApiModelProperty("输血史")
    @DictParent("sys_have_no")
    private String transBloodHistory;

    @ApiModelProperty("有无既往疾病")
    @DictParent("sys_have_no")
    private String hasHistoryDisease;

    @ApiModelProperty("既往病史明细")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    @ExcelProperty(value = {"既往史", "既往病史明细"}, converter = HistoryDiseaseDetailConverter.class)
    private List<HistoryDiseaseDetail> historyDiseaseDetails;

    /** 药物过敏史 */
    @ApiModelProperty("有无药物过敏史")
    @DictParent("sys_have_no")
    private String hasMedicationsHistory;

    @Column(typeHandler = Fastjson2TypeHandler.class)
    @ApiModelProperty("药物过敏史明细")
    private List<String> medicationsHistoryNames;

    /** 吸烟/饮酒 */
    @ApiModelProperty("是否吸烟")
    @DictParent("smoke_dict")
    private String isSmoke;

    @ApiModelProperty("每天吸烟支数")
    private String smokingCountPerDay;

    @ApiModelProperty("吸烟年数")
    private String smokingYears;

    @ApiModelProperty("吸烟指数")
    private String smokingScore;

    @ApiModelProperty("戒烟年数")
    private String quitSmokingTime;

    @ApiModelProperty("是否饮酒")
    @DictParent("is_drink_dict")
    private String isDrink;

    @ApiModelProperty("每天饮酒量")
    private String dailyAlcoholIntake;

    @ApiModelProperty("饮酒年数")
    private String drinkingYears;

    @ApiModelProperty("戒酒年数")
    private String quitDrinkingYears;

    /** 家族肿瘤史 */
    @ApiModelProperty("有无家族肿瘤史")
    @DictParent("sys_have_no")
    private String hasFamilyHistory;

    @ApiModelProperty("家族肿瘤史明细")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    private List<FamilyHistoryDetail> familyHistoryDetails;

    @ApiModelProperty("有无非遗传性家族史")
    @DictParent("sys_have_no")
    private String hasNonGenetic;

    @Column(typeHandler = Fastjson2TypeHandler.class)
    @ApiModelProperty("无非遗传性家族史明细")
    private List<NonGeneticDetail> nonGeneticDetails;

    @ApiModelProperty("数据检查原因")
    private String editReason;

    @ApiModelProperty("终止原因")
    private String stopReason;

    @ApiModelProperty("知情同意书文件")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    private List<FileVo> informedConsentFile;

    @ApiModelProperty("研究病历文件")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    private List<FileVo> studyCaseFile;

    @ApiModelProperty(value = "下一次随访提醒时间")
    @DateTimeFormat("yyyy年MM月dd日")
    private Date visitRemindDate;

}
